////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Filename:    IndianaJoanGuts.h                                      //
//  Developer:				                                                  //
//  Create date:			                                                  //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Description: This is the class declaration for the slot gut of the        //
//               Australian Slot machine called Witches And Wizards.          //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//        2010 - Riplife Gaming.  All rights reserved.						  //
////////////////////////////////////////////////////////////////////////////////

#if !defined(__IndianaJoanGUTS_H__)
#define __IndianaJoanGUTS_H__

#define FREE_SPIN_ROUNDS 10

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "slotguts.h"
#include "getrand.h"

class IndianaJoanGuts : public SlotGuts
{
public:
	IndianaJoanGuts();

	virtual ~IndianaJoanGuts();

private:
	// Shared enums between client and server
	#include "IndianaJoanCommon.h"

	// Helpful lookup arrays.
	static SpinResult m_aLineWinSpinResults[][6];

	static SpinResult m_aScatterWinSpinResults[][6];

	// Inline functions to use with the arrays that also do
	// bounds checking.
	static SpinResult lookupLineWinSpinResult( uint8 nIconType, uint8 nCount )
	{
		if ( nIconType < NUM_VALID_ICONS && nCount < 6 )
		{
			return m_aLineWinSpinResults[ nIconType ][ nCount ];
		}

		ASSERT( false );
		return EVT_INVALID;
	}

	static SpinResult lookupScatterWinSpinResult( uint8 nIconType, uint8 nCount )
	{
		if ( nIconType < NUM_VALID_ICONS && nCount < 6 )
		{
			return m_aScatterWinSpinResults[ nIconType ][ nCount ];
		}

		ASSERT( false );
		return EVT_INVALID;
	}

	SpinResult getLineWinResultWithPossibleSubstitution( uint8* stops, uint8 line, uint8 testIcon, bool& bSubstitution );

	// Helper functions for classifyScatters.
	void tryForJackpot( SlotSpin* spin );

	SpinResult getScatterWinResult( SlotSpin* spin, uint8 testIcon, int32& scatterPositions ) const;
	
	void evaluateScatterWin( SlotSpin* spin, SpinResult srScatterResult, int32 scatterPositions );

	void removePendingBonus();
	void addPendingBonus(int32 Orbits);

protected:
	//virtual int32 getNumLinesBet();

public:
	virtual void classifyStops( SpinLine* spinline, uint8* stops, uint8 bet, uint8 line,
		uint8& rtnresult, uint8& multiplier );

	virtual void classifyScatters( SlotSpin *spin );

    virtual bool8 isValidGuts();

    virtual void getGameModeMultiplierAndNoteId( uint8& nGameModeMultiplier, uint8& nNoteId );

	virtual bool8 processClientData( uint8 bonusGameType, int32 bonusDataCount, int32 *bonusData );

	virtual bool8 getForceReferenceGameNumber();


protected:

	bool8 m_bReferenceGamenumber;

	// Override these framework functions.
	virtual void preSpinClassifyResults( SlotSpin* spin );
    virtual void postSpinClassifyResults( SlotSpin* spin );

	virtual bool8 hasSavedGames();

	virtual void Debug_SetLoserStops( uint8* pStops );

	//virtual void initDebugFunctionMap();

	int32 getProgressiveValue();

	void initializeSubGame ( uint8 Phase );
	void generateDoors( uint8 Pool, bool8 Phase1Only );
	void generateOrbits( uint8 Pool );

};  


#endif // !defined(__IndianaJoanGUTS_H__)
